#!/bin/bash
#########################################################################
# Author: qianqiang@jd.com
SUBJECT=""
MESSAGE=""
USER_NAME='ares'
USER_PASSWORD='wyqnj0624#HEJIU'
SMTP_SERVER='smtp.jd.com'
FROM_EMAIL='ares@jd.com'
TO_EMAIL=''
MESSAGE_CONTENT_TYPE='html'
MESSAGE_CHARSET='UTF8'
currentPath=`pwd`
while getopts "s:m:e:" arg
do
    case $arg in
        s)
            SUBJECT=$OPTARG;;
        m)
			MESSAGE=$OPTARG;;
		e)
            TO_EMAIL=$OPTARG;; 
    esac
done
#RECEIVER=${TO_EMAIL}',sstp-xplatform@jd.com'
attachFile=${currentPath}'/out.zip'
sendEmail -f $FROM_EMAIL -t $TO_EMAIL -s $SMTP_SERVER -u $SUBJECT -o message-content-type=$MESSAGE_CONTENT_TYPE -o message-charset=$MESSAGE_CHARSET -xu $USER_NAME -xp $USER_PASSWORD -m $MESSAGE -a $attachFile -o tls=no